<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'newshare.jsp' starting page</title>

		<script type="text/javascript" src="/FileBackup/js/jquery.js">
</script>

		<script type="text/javascript">
$(document).ready(function() {
	$.get(
		      'folderSelectAction.action',
		     null,
		      function(data) //回传函数
		      { 
		      	 var list=eval('('+data+')');
		      	 alert(data);
		       var select=document.getElementById("folderId");
		       select.options.length=0;
		       
		       　for(var i=0;i<list.length;i++){
		       var option=document.createElement("option");
				option.text=list[i].name;
		       option.value=list[i].id;
         		select.add(option);
 　　}
		      });
		      $.get(
		      'userSelectAction.action',
		     null,
		      function(data) //回传函数
		      { 
		      	 var list=eval('('+data+')');
		       var select=document.getElementById("userId");
		       select.options.length=0;
		       
		       　for(var i=0;i<list.length;i++){
		       var option=document.createElement("option");
				option.text=list[i].name;
		       option.value=list[i].id;
         		select.add(option);
 　　}
		      });
});
function submitlist(){
	var form=document.getElementById("form1");
			form.submit();
}
</script>
	</head>

	<body>


		<form id="form1" name="form1" method="post"
			action="submitShareAction.action">
			<table align="center" width="200" border="0">
				<tr>
				<td>共享文件夹：</td>
					<td>
						<select class="select" id="folderId" name="folderId"
							style="width: 100px"></select>
					</td>
				</tr>
				<tr>
				<td>共享用户：</td>
					<td>
						<select class="select" id="userId" name="userId"
							style="width: 100px"></select>
					</td>
				</tr>
				<tr>
					<td>
						<input type="button" onclick="submitlist()" name="button" id="button" value="提交" />
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
